<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>示例7</title>
</head>
<body>
    <h1>原型链</h1>
    <script>
        function Student(name,age){
            this.name = name;
            this.age = age;
        }

        const a = {aaa:'hello aaa'}
        const b = {bbb:'hello bbb'}
        const c = {ccc:'hello ccc'}

        Student.prototype = a;
        a.__proto__  = b;
        b.__proto__  = c;

        const stu1 = new Student('张三',18);
        console.log(stu1)
        console.log(stu1.aaa)
        console.log(stu1.bbb)
        console.log(stu1.ccc)
        console.log(a.aaa,a.bbb)
    </script>
</body>
</html>